//bool, ObjList objs, str OUT reasonText

Hero this;

this = objs[0].AsHero(); 

if(!.IsValid()) return false;

if(.command == "retreat_notai"){
	if(.EnemiesInSight()){ 
		reasonText = Translate("Hero retreat !");
		return false;
	}
}
if(.command == "retreat_bld_notai"){
	if(.EnemiesInSight()){ 
		reasonText = Translate("Hero retreat !");
		return false;
	}
}

if(.command != "stand_position"){
	if(.HasItem("irage_battle")){
		reasonText = Translate("Hero in battle !");
		return false;
    }
}

return true;
